👄👂🎴 🕸️
Supervised learning
Licensed under ::
by ()
@


Features

Features are observable and measurable properties or characteristics used to describe data in both machine learning and human experience. 

In ML, features are input variables—raw (e.g., pixel intensities, audio waveforms) or engineered (e.g., embeddings, statistical summaries)—that models use to make predictions. 

In human experience, features represent sensory or cognitive details like color, texture, pitch, or emotional tone, helping interpret and navigate the world.

Features (human experience)

In human experience, features can be thought of as the observable or measurable characteristics that we use to interpret and make decisions about the world around us. These features can come from different sensory modalities or cognitive processes.

Visual modality: Color, shape, size, motion, texture (raw); patterns, symmetry, depth cues (derived)

Auditory modality: pitch, volume, tempo, rhythm (raw); speech patterns, tone of voice (derived)

haptics ? emotions ? language ?

Features (machine learning)

Features represent the input variables used by a machine learning model to make predictions or classifications. They are the building blocks of the dataset and provide the information necessary for the model to learn relationships and patterns. Features can be:

Numerical: Continuous or discrete values (e.g., height, number of words).

Categorical: Representing distinct groups (e.g., color, category labels).

Derived: Transformed or engineered values combining raw data (e.g., ratios, log values).

Text Processing

Raw Features: occurence of specific character sequences, word or token counts, sequence length

Engineered Features: Word "embeddings" (e.g., Word2Vec, BERT embeddings),

Context: In sentiment analysis, embeddings provide dense, meaningful representations of text features.

Image processing

Raw Features: Pixel intensity values, RGB color values.

Engineered Features: Haar features, Gabor wavelets, Histogram of gradients (HOG), edge counts, convolutional feature maps.

Context: In object detection, pixel patterns or edge-based features help detect objects in the image.

Speech processing

Raw Features: Waveform amplitudes, signal energy.

Engineered Features: Mel-frequency cepstral coefficients (MFCCs), spectrogram data, pitch.

Context: In speech recognition, MFCCs are features extracted to characterize the audio signal.

Feature detection

Canny%20edge%20detector%20is%20an%20old-school%20powerful%20means%20for%20contour%20feature%20extraction%20%2F%20detection.

Canny edge detector is an old-school powerful means for contour feature extraction / detection.

Feature detection is the process of identifying significant patterns, structures, or attributes in raw data to aid analysis and decision-making. 

In images, this includes methods like SIFT, SURF, and Haar cascades for detecting edges, corners, or keypoints. 

In audio, algorithms like MFCCs extract time-frequency characteristics, while text relies on tokenization and n-grams. 

Feature selection

Feature selection involves choosing the most relevant features from a dataset to improve model accuracy, reduce overfitting, and enhance computational efficiency. Techniques include filters (e.g., chi-square tests), wrappers (e.g., recursive feature elimination), and embedded methods like LASSO. Boosting algorithms (e.g., AdaBoost, Gradient Boosting, XGBoost) also inherently perform feature selection by iteratively focusing on features with the highest predictive power.
 
Feature selection process is crucial in high-dimensional datasets, enabling models to concentrate on the most impactful data while discarding irrelevant or redundant features.

Supervised learning & Human learning

Supervised learning parallels human learning through its reliance on guidance from labeled examples, similar to how humans learn with feedback. For instance, when a child learns to identify objects, they receive input (the object) and a corresponding label (e.g., "dog" or "apple") from a teacher or parent. Mistakes are corrected, reinforcing the connection between input and label, much like how supervised learning algorithms adjust their predictions based on errors.

Categorization

Categorization is a fundamental human cognitive process where we group objects, ideas, or experiences based on shared characteristics.

Classifiers

A classifier in machine learning is a model or algorithm designed to categorize data into predefined groups or labels. It takes input data, analyzes its features, and assigns it to a specific class based on learned patterns from training data. For example, a classifier might identify whether an email is spam or not spam, or recognize handwritten digits. Classifiers are essential in supervised learning tasks and operate by minimizing errors in predictions through training on labeled datasets. Common types include neural networks, support vector machines, decision trees etc.

Support Vector Machines

A Support Vector Machine (SVM) is a machine learning method that helps divide data into categories. Imagine drawing a line (or boundary) on a graph to separate different groups of points, like cats and dogs. SVM finds the best line that keeps the groups as far apart as possible. For trickier data, it can use special math (called kernels) to draw curves or work in higher dimensions.

Decision Trees

A Decision Tree is a visual and intuitive machine learning method that makes decisions by asking questions about the data. It works like a flowchart, starting with a question at the top and branching out based on answers. These questions are not just yes/no, but can also be comparisons, like "Is the age greater than 18?" or "Is the temperature below 30°C?" Each split is chosen using a quantitative measure, such as information gain or Gini impurity, to find the best threshold for separating the data.

Exercicio: AI Unplugged 1

You will form teams of two and use the training data to develop criteria for distinguishing biting from non-biting monkeys. These must be clearly noted so that they can be applied to new examples by another team afterwards. A possibility to record the criteria is a decision tree. It should be the goal that the existence or absence of a particular feature permits a clear assignment to one of the groups. The use of decision trees is optional, alternatively, it is also possible to explicitly write down decision rules.

At the end ofthe training phase, the criteria formulated are exchanged with another team. Now, the students are shown the pictures of the remaining monkeys (test data) one after the other. For each image, the teams decide whether the monkey will bite or not using the scheme of rules developed by their classmates...

Training

In supervised machine learning, training is the process of teaching a model, like a classifier, to make accurate predictions by learning patterns from labeled data. Each data point in the training set includes features (characteristics or inputs that describe the data, like size or color) and a corresponding label (the correct output or category). The model uses this data to adjust its internal parameters, minimizing the error between its predictions and the actual labels. This is done through algorithms like gradient descent. The goal is to generalize from the training data, enabling the classifier to make accurate predictions on new, unseen data.

Testing

In supervised machine learning, *testing* (or *inference*) is the process of evaluating a trained model's ability to make accurate predictions on new, unseen data. During this phase, the model is given data points with *features* (inputs like size or color) but without the labels it was trained on. The model uses the patterns it learned during training to predict the labels for this data. The results are then compared to the actual labels (if available) to measure the model's performance using metrics like accuracy or precision. Inference is the final application of the model to make real-world predictions.

Evaluation

Binary classifiers are evaluated by comparing their predictions to the actual outcomes using a confusion matrix. This is a table with four categories: True Positives (TP), where the classifier correctly predicts a positive outcome; True Negatives (TN), where it correctly predicts a negative outcome; False Positives (FP), where it wrongly predicts a positive; and False Negatives (FN), where it misses a positive case. Metrics like accuracy (overall correctness), precision (focus on positives), and recall (how well positives are found) are calculated from this matrix, helping to assess the classifier’s performance.

Validating

In supervised machine learning, *validating* is the process of fine-tuning and assessing a model's performance during training to ensure it generalizes well to unseen data. Unlike testing, validation occurs on a separate *validation set*, distinct from both training and testing data. The model uses the *features* of this set to make predictions, which are compared to the actual labels to calculate metrics like accuracy or loss. This helps monitor overfitting or underfitting and guides adjustments to model parameters or hyperparameters (e.g., learning rate or regularization). Validation ensures the classifier is optimized before its final evaluation on the test set.